<?php 
/////////////////////////////////////////////////
//生成订单信息 
//
/////////////////////////////////////////////////

if (isset($_POST["amount"]) && $_POST["amount"] > 0 && $_POST["amount"] < 101)
{
	//echo "fee is valid<br/>";
	//echo "您要充值".$_POST["amount"]."元。<br/>";
	$alimoney = $_POST["amount"];	
}
else
{
	//echo "错误的金额，返回重新输入。<br/>";
	//echo "<a>".."</a>";
	header("Location: http://ijinbu.org/iask/pay/pay.php?uid=".$_POST['uid']."&username=".$_POST['username']."&invalidfee=1");
	return;
}

$aliorder = "我爱进步网金币";
$alibody = "我爱进步网金币";
$orderno = $_POST['uid'].date(Ymdhis).$alimoney.rand();

//插入订单状态到数据库
include("../update-order.php");
if (!is_order_exists($orderno))
  insert_order ($orderno, "topay", $alimoney, $_POST['uid'], $_POST['username']);
else
  update_order_state ($orderno, "topay");
//return ;
